// 数据库操作
const mongoose = require('mongoose');
// 对象规则验证
const Joi = require('joi');
// 模型规则类
const Schema = mongoose.Schema;

// 首页导航规则模型
const NavModel = new Schema({
		// 首页导航
		title: {
			type: String, 
			required:true,
			default: ''
		},
		icon: {
			type: String,
			default: ''
		},
		cate_id: {
			type: mongoose.Schema.Types.ObjectId,
			ref: 'CategoryOne'
		},
		// 添加时间
		add_time: {
			type: Date,
			default: Date.now
		}
}, {
	versionKey: false,
});

// 创建首页导航集合 
const Navigation = mongoose.model('navigation',NavModel,'navigation');

// 导出模块成员
module.exports = {
	Navigation
}
